#pragma once

#include <iostream>
#include <string>
#include <cstdio>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>

const std::string gpath = "/home/shenyu";
int gprojId = 0x6666;
//OS申请内存是按块申请,一般是1KB,2KB,4KB,4MB
//所以共享内存大小设置为块的整数倍比较合适
int gshmsize = 4096;

//将key值转化为16进制字符串
std::string ToHex(key_t k)
{
    char buffer[64];
    snprintf(buffer, sizeof(buffer), "0x%x", k);
    return buffer;
}